#include <iostream>
#include<vector>
#include "split_string.h" 

using std::vector;
using std::string;
 
vector<string> split(const string& line, char x)
{
	int flag=0;
	int count=0;
	string as="";
	vector<string> array;
	string *start=new string;
	*start=line;
	if(line.length()==0)
	{
		return array;	
	}
	for(int i=0;i<=line.length();i++)
	{
		if(start[0][i]==x||i==line.length())
		{
			for(int j=flag;j<i;j++)
			{
				as+=start[0][j];
			}
			array.insert(array.begin()+count++,as);
			flag=i+1;
			as="";
		}
	}
	return array;
}
